org.eclipse.vtp.framework.engine.http
Class DeploymentExecution

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.http.DeploymentExecution
All Implemented Interfaces:
IControllerCommandVisitor, IInteractionTypeSelection, ILinkFactory, IRenderingQueue, ICommandVisitor, IExecutionDescriptor, IRunnableCommandVisitor

public class DeploymentExecution
extends java.lang.Object
implements IExecutionDescriptor, ILinkFactory, IRenderingQueue, IRunnableCommandVisitor, IControllerCommandVisitor, IInteractionTypeSelection

A single execution on the HTTP connector.

Author:
Lonnie Pryor

Constructor Summary
DeploymentExecution(java.lang.String id, DeploymentSession session, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, java.util.Map parameterValues)
          Creates a new DeploymentExecution.
 
Method Summary
 void clearParameter(java.lang.String parameterName)
          Clears the value of the parameter with the specified name.
 ILink createAbortLink()
           
 ILink createNextLink()
           
 ILink createResourceLink(java.lang.String path)
           
 IDocument doAbort()
          Generates the abort document and ends the interaction.
 IDocument doNext()
          Generates the next document in the interaction.
 java.lang.String getExecutionID()
          Returns the ID of the execution sequence being described.
 java.lang.String getParameter(java.lang.String parameterName)
          Returns the value of the parameter with the specified name or null if no such parameter exists.
 java.lang.String[] getParameterNames()
          Returns the names of the parameters available to the execution sequence.
 java.lang.String[] getParameters(java.lang.String parameterName)
          Returns the values of the parameter with the specified name or null if no such parameter exists.
 IInteractionType getSelectedInteractionType()
           
 java.lang.Object getService(java.lang.String identifier)
          Returns the service selected for the specified identifier or null if no such service exists.
 java.lang.String[] getServiceIdentifiers()
          Returns the identifiers of all the externally-provided services.
 boolean isEmpty()
           
 ConversationCommand next()
           
 ConversationCommand peek()
           
 void setParameter(java.lang.String parameterName, java.lang.String value)
          Sets the value of the parameter with the specified name or clears it if the value is null.
 void setParameters(java.lang.String parameterName, java.lang.String[] values)
          Sets the values of the parameter with the specified name or clears them if the value is null or empty.
 void setUrlEncoded(boolean urlEncoded)
           
 java.lang.Object visitExit(ExitCommand exitCommand)
          Called when this visitor is passed to an exit command instance.
 java.lang.Object visitForward(ForwardCommand forwardCommand)
          Called when this visitor is passed to a forward command instance.
 java.lang.Object visitInclude(IncludeCommand includeCommand)
          Called when this visitor is passed to an include command instance.
 java.lang.Object visitRunnable(IRunnableCommand runnableCommand)
          Called when passed to a runnable command.
 java.lang.Object visitUnknown(ICommand unknownCommand)
          Called when an implementation-dependent visit method is not available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeploymentExecution

public DeploymentExecution(java.lang.String id,
                           DeploymentSession session,
                           javax.servlet.http.HttpServletRequest httpRequest,
                           javax.servlet.http.HttpServletResponse httpResponse,
                           java.util.Map parameterValues)
Creates a new DeploymentExecution.

Parameters:
id - The execution ID.
session - The process session.
httpRequest - The HTTP request.
httpResponse - The HTTP response.
Method Detail

doNext

public IDocument doNext()
Generates the next document in the interaction.

Returns:
The next document in the interaction.

doAbort

public IDocument doAbort()
Generates the abort document and ends the interaction.

Returns:
The abort document and ends the interaction.

getExecutionID

public java.lang.String getExecutionID()
Description copied from interface: IExecutionDescriptor
Returns the ID of the execution sequence being described.

Specified by:
getExecutionID in interface IExecutionDescriptor
Returns:
The ID of the execution sequence being described.

getParameterNames

public java.lang.String[] getParameterNames()
Description copied from interface: IExecutionDescriptor
Returns the names of the parameters available to the execution sequence.

Specified by:
getParameterNames in interface IExecutionDescriptor
Returns:
The names of the parameters available to the execution sequence.

getParameter

public java.lang.String getParameter(java.lang.String parameterName)
                              throws java.lang.NullPointerException
Description copied from interface: IExecutionDescriptor
Returns the value of the parameter with the specified name or null if no such parameter exists.

Specified by:
getParameter in interface IExecutionDescriptor
Parameters:
parameterName - The name of the parameter to return.
Returns:
The values of the parameter with the specified name or null if no such parameter exists.
Throws:
java.lang.NullPointerException - If the specified parameter name is null.

getParameters

public java.lang.String[] getParameters(java.lang.String parameterName)
                                 throws java.lang.NullPointerException
Description copied from interface: IExecutionDescriptor
Returns the values of the parameter with the specified name or null if no such parameter exists.

Specified by:
getParameters in interface IExecutionDescriptor
Parameters:
parameterName - The name of the parameter to return.
Returns:
The values of the parameter with the specified name or null if no such parameter exists.
Throws:
java.lang.NullPointerException - If the specified parameter name is null.

setParameter

public void setParameter(java.lang.String parameterName,
                         java.lang.String value)
                  throws java.lang.NullPointerException
Description copied from interface: IExecutionDescriptor
Sets the value of the parameter with the specified name or clears it if the value is null.

Specified by:
setParameter in interface IExecutionDescriptor
Parameters:
parameterName - The name of the parameter to set.
value - The value of the parameter with the specified name or null to clear the value.
Throws:
java.lang.NullPointerException - If the supplied parameter name is null.

setParameters

public void setParameters(java.lang.String parameterName,
                          java.lang.String[] values)
                   throws java.lang.NullPointerException
Description copied from interface: IExecutionDescriptor
Sets the values of the parameter with the specified name or clears them if the value is null or empty.

Specified by:
setParameters in interface IExecutionDescriptor
Parameters:
parameterName - The name of the parameters to set.
values - The values of the parameter with the specified name or null or to clear the values.
Throws:
java.lang.NullPointerException - If the supplied parameter name is null.

clearParameter

public void clearParameter(java.lang.String parameterName)
                    throws java.lang.NullPointerException
Description copied from interface: IExecutionDescriptor
Clears the value of the parameter with the specified name.

Specified by:
clearParameter in interface IExecutionDescriptor
Parameters:
parameterName - The name of the parameter to clear.
Throws:
java.lang.NullPointerException - If the supplied parameter name is null.

getServiceIdentifiers

public java.lang.String[] getServiceIdentifiers()
Description copied from interface: IExecutionDescriptor
Returns the identifiers of all the externally-provided services.

Specified by:
getServiceIdentifiers in interface IExecutionDescriptor
Returns:
The identifiers of all the externally-provided services.

getService

public java.lang.Object getService(java.lang.String identifier)
                            throws java.lang.NullPointerException
Description copied from interface: IExecutionDescriptor
Returns the service selected for the specified identifier or null if no such service exists.

Specified by:
getService in interface IExecutionDescriptor
Parameters:
identifier - The identifier of the service to return.
Returns:
The service selected for the specified identifier or null if no such service exists.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

setUrlEncoded

public void setUrlEncoded(boolean urlEncoded)
Specified by:
setUrlEncoded in interface ILinkFactory

createAbortLink

public ILink createAbortLink()
Specified by:
createAbortLink in interface ILinkFactory

createNextLink

public ILink createNextLink()
Specified by:
createNextLink in interface ILinkFactory

createResourceLink

public ILink createResourceLink(java.lang.String path)
Specified by:
createResourceLink in interface ILinkFactory

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface IRenderingQueue

peek

public ConversationCommand peek()
Specified by:
peek in interface IRenderingQueue

next

public ConversationCommand next()
Specified by:
next in interface IRenderingQueue

visitRunnable

public java.lang.Object visitRunnable(IRunnableCommand runnableCommand)
                               throws java.lang.NullPointerException
Description copied from interface: IRunnableCommandVisitor
Called when passed to a runnable command.

Specified by:
visitRunnable in interface IRunnableCommandVisitor
Parameters:
runnableCommand - The command to visit.
Returns:
An implementation-specific result.
Throws:
java.lang.NullPointerException - If the supplied command is null.

visitInclude

public java.lang.Object visitInclude(IncludeCommand includeCommand)
Description copied from interface: IControllerCommandVisitor
Called when this visitor is passed to an include command instance.

Specified by:
visitInclude in interface IControllerCommandVisitor
Parameters:
includeCommand - The include command this visitor was passed to.
Returns:
An implementation-specific result.

visitExit

public java.lang.Object visitExit(ExitCommand exitCommand)
Description copied from interface: IControllerCommandVisitor
Called when this visitor is passed to an exit command instance.

Specified by:
visitExit in interface IControllerCommandVisitor
Parameters:
exitCommand - The exit command this visitor was passed to.
Returns:
An implementation-specific result.

visitForward

public java.lang.Object visitForward(ForwardCommand forwardCommand)
Description copied from interface: IControllerCommandVisitor
Called when this visitor is passed to a forward command instance.

Specified by:
visitForward in interface IControllerCommandVisitor
Parameters:
forwardCommand - The forward command this visitor was passed to.
Returns:
An implementation-specific result.

visitUnknown

public java.lang.Object visitUnknown(ICommand unknownCommand)
                              throws java.lang.NullPointerException
Description copied from interface: ICommandVisitor
Called when an implementation-dependent visit method is not available.

Specified by:
visitUnknown in interface ICommandVisitor
Parameters:
unknownCommand - The command to visit.
Returns:
An implementation-specific result.
Throws:
java.lang.NullPointerException - If the supplied command is null.

getSelectedInteractionType

public IInteractionType getSelectedInteractionType()
Specified by:
getSelectedInteractionType in interface IInteractionTypeSelection